﻿@{
    Layout = "~/Views/Shared/_LayuiLayout.cshtml";
}
<!-- 数据表格 -->
<table class="layui-table" lay-filter="tbList" lay-data="{id:'tbList',url:'@Url.Action("GetRecord", "Order",new {Id= ViewBag.Id})', page:true, method:'post',height:'full-128'}">
    <thead>
        <tr>
            <th lay-data="{field:'Type', align:'center', sort: true, templet: '#buttonType'}">类型</th>
            <th lay-data="{field:'CreationTime', align:'center', sort: true}">操作时间</th>
        </tr>
    </thead>
</table>

<!-- js代码-->
<script type="text/html" id="buttonType">
    {{#  if(d.Type==10){ }}
    <button class="layui-btn layui-btn-xs">下单</button>
    {{#  } else if(d.Type==20){ }}
    <button class="layui-btn layui-btn-xs">支付</button>
    {{#  } else if(d.Type==30){ }}
    <button class="layui-btn layui-btn-xs">确认</button>
    {{#  } else if(d.Type==40){ }}
    <button class="layui-btn layui-btn-xs">发货</button>
    {{#  } else if(d.Type==50){ }}
    <button class="layui-btn layui-btn-xs">取消</button>
    {{#  } }}
</script>
@section scripts{
    <script>
        var $, layer;//这两个变量设置为当前页的全局变量
        layui.use(['table', 'form', 'laydate'], function () {
            var table = layui.table, form = layui.form, laydate = layui.laydate;
            $ = layui.jquery;
            layer = layui.layer;

            //刷新(添加修改等子页面也需要用到)
            reload = function () {
                table.reload('tbList');
            }
        });
    </script>
}